Skip to content

docs(test-filters): add migration callout for --filter → --treenode-filter#5628

Merged
thomhurst merged 1 commit intothomhurst:mainfrom
johnkattenhorn:docs/filter-migration-callout
Apr 19, 2026
Merged

docs(test-filters): add migration callout for --filter → --treenode-filter#5628
thomhurst merged 1 commit intothomhurst:mainfrom
johnkattenhorn:docs/filter-migration-callout

Conversation

@johnkattenhorn
Copy link
Copy Markdown
Contributor

Small docs-only change. Adds a tip callout to the top of the existing test filters page so users coming from xUnit / NUnit / MSTest find the --filter--treenode-filter mapping before they go looking for it.

Why

VSTest's dotnet test --filter "Category=X" is familiar to anyone migrating. On Microsoft.Testing.Platform the flag is silently rejected, the MTP help is printed, and the run exits with Zero tests ran. It looks like a test failure when it's actually just an unrecognised flag — I hit this myself running an AI dev agent against a TUnit project (the agent spent ~11 minutes trying filter variations before giving up). Easy signposting seemed like the lightest-weight fix.

Scope

Single file: docs/docs/execution/test-filters.md. One callout block plus a three-row mapping table, links back into the existing filter examples that already cover the destination syntax comprehensively. Nothing else touched.

Alternatives considered

  • Adding to each of the three migration pages (xunit.md, nunit.md, mstest.md). They currently focus on code syntax rather than CLI, so one central callout felt lighter than three duplicate ones.
  • A brand-new "Running tests from xUnit/NUnit" page. Felt like overkill for a small signpost.

Love TUnit — using it heavily on a new project. Thanks for building it.

…ilter

Adds a tip callout at the top of the existing test filters page to
signpost the VSTest → Microsoft.Testing.Platform filter syntax change
for users migrating from xUnit / NUnit / MSTest. Includes a small
mapping table with the three most common --filter shapes.

Motivation: `dotnet test --filter "Category=X"` is silently rejected on
MTP (help printed, "Zero tests ran"). Looks like a test failure when
it's just an unrecognised flag. Easy to miss that --treenode-filter
is the replacement until you stumble on this page.

Single-file docs-only change. The existing filter examples below the
callout already cover the destination syntax comprehensively.
@codacy-production
Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

TIP This summary will be updated as you push new changes. Give us feedback

@johnkattenhorn
Copy link
Copy Markdown
Contributor Author

One alternative we considered but deliberately kept out of this PR: teaching the test runner to detect --filter and emit a "Did you mean --treenode-filter?" hint on the way out, instead of just printing the full help. That would give immediate feedback to both humans and AI agents — the 11-minute discovery loop I described in the PR would never start in the first place.

Not included here because it's a bigger surface (likely Microsoft.Testing.Platform-level CLI parsing rather than TUnit itself) and docs felt like the right first step. Flagging it in case it's worth an upstream conversation.

@thomhurst
Copy link
Copy Markdown
Owner

Thanks!

@thomhurst thomhurst merged commit b5396de into thomhurst:main Apr 19, 2026
2 checks passed
This was referenced Apr 20, 2026
This was referenced Apr 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants